<?php

use yii\bootstrap\ActiveForm;
use yii\helpers\Html;
use common\widgets\webuploader\Files;
/* @var $this yii\web\View */
/* @var $model common\models\NavItem */
/* @var $form yii\bootstrap\ActiveForm */
?>
<style type="text/css">
.field-product-show_type{display:flex;align-items: center;}
#product-show_type{display: flex;align-items: center;}
#product-show_type .radio{margin: 0;padding: 0;margin-left: 10px;}
</style>
<div class="row">
    <div class="col-lg-12">
        <div class="box">
            <div class="box-header with-border">
                <h3 class="box-title">基本信息</h3>
            </div>
            <?php $form = ActiveForm::begin(); ?>
            <div class="box-body">
                <div class="col-lg-12">
                    <div class="row">
                        <div class="col-sm-4">
                            <?= $form->field($model, 'cate_id')->dropDownList($cates, [
                                'prompt' => '请选择',
                            ]) ?>
                        </div>
                    </div>
                    <?= $form->field($model, 'name') ?>
                    <?= $form->field($model, 'intro')->textarea(['maxlength' => 1024]) ?>
                    <div class="price">
                        <?= $form->field($model, 'real_price')?>
                        <?= $form->field($model, 'market_price')?>
                        <?= $form->field($model, 'vip_price')?>
                        <?= $form->field($model, 'virtual_sale')?>
                    </div>
                    <?= $form->field($model, 'fenxiao_money')->hint("给分销商的金额。需要在【网站设置】开启分销"); ?>
                    <?= $form->field($model, 'show_type')->radioList(['1' => '优先详情', '2' => '优先章节'])->label('详情显示方式') ?>
                    <?= $form->field($model, 'cover')->widget(Files::class, [
                        'type' => 'images',
                        'config' => [
                            //'compress'=>true,
                            'pick' => [
                                'multiple' => true,
                            ],
                            // 'formData' => [
                            //      // 不配置则不生成缩略图
                            //     'thumb' => [
                            //         [
                            //             'width' => 600,
                            //             'height' => 400,
                            //         ]
                            //     ]
                            // ]
                        ]
                    ])->hint("建议大小：  宽600px 高400px"); ?>
                    <?= $form->field($modelData, 'content')->widget(\common\widgets\ueditor\UEditor::class) ?>
                    <?= $form->field($model, 'is_top')->checkbox() ?>

                    <?= $form->field($model, 'status')->checkbox() ?>

                    <div class="form-group">
                        <?= Html::submitButton($model->isNewRecord ? '创建' :  '保存', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
    <?php ActiveForm::end(); ?>
<style type="text/css">
.price{display: flex;}
.price .form-group{margin-right: 10px;}
</style>